﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestAccountService.AccountServiceReference;

namespace TestAccountService
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                AccountServiceClient client = new AccountServiceClient();
                Account acc = new Account();

                Console.WriteLine("Please enter user name:");
                acc.UserName = Console.ReadLine();

                Console.WriteLine("Please enter password:");
                acc.Password = Console.ReadLine();

                Console.WriteLine("Do you want to remember? (Y/N)");
                string remember = Console.ReadLine();
                switch (remember)
                {
                    case "Y":
                        acc.Remember = true;
                        break;
                    case "N":
                        acc.Remember = false;
                        break;
                    default:
                        acc.Remember = false;
                        break;
                }

                Console.WriteLine("Please enter the role you want to verify:");
                string role = Console.ReadLine();

                string errorMessage = string.Empty;
                Console.WriteLine("Result:");
                Console.WriteLine(client.Login(acc, role.Trim(), ref errorMessage));
                Console.WriteLine(errorMessage);
                Console.ReadKey();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            
        }
    }
}
